package design_pattern.proxy.proxy_pattern_moving;

/**
 * 测试类
 * @author 15594
 */
public class Demo {
    public static void main(String[] args) {
        IUserDao userDao = new UserDaoImpl();
        ProxyFactory proxyFactory = new ProxyFactory(userDao);
        IUserDao proxyInstance = (IUserDao)proxyFactory.getProxyInstance();

        System.out.println(proxyInstance.queryUserNameById(1));
        proxyInstance.updateUserNameById("小明",1);
    }
}
